package com.world;

import java.awt.event.KeyEvent;

import base.input.IInput;
import base.render.gui.Gui;
import base.world.WorldOfButtons;

import com.render.gui.GuiButtonExit;
import com.render.gui.GuiButtonLoadTest;
import com.render.gui.GuiButtonNewTest;
import com.render.gui.GuiMenu;
import com.render.gui.GuiTitle;

public class WorldNewTest extends WorldOfButtons
{
	private GuiTitle title;
	
	public void initWorld()
	{
		this.livingCreate(new GuiMenu(Gui.getWindowWidth() / 2, Gui.getWindowHeight() / 2));
		this.title = (GuiTitle) this.livingCreate(new GuiTitle(-64, 64, "Troy Nerd Trainer"));
		this.addButton(new GuiButtonNewTest(this.getUniqueButtonID(), -64, 160));
		this.addButton(new GuiButtonLoadTest(this.getUniqueButtonID(), -64, 200));
		this.addButton(new GuiButtonExit(this.getUniqueButtonID(), -64, 240));
		
		this.getInputObj().registerKey(KeyEvent.VK_SPACE, (IInput) this);
	}
	
	public void onInputUpdate(int par1, boolean par2)
	{
		super.onInputUpdate(par1, par2);
		if (par1 == KeyEvent.VK_SPACE && par2)
		{
			this.title.setRandomTitleColor();
		}
	}
}
